/**
 * 
 */
package fb.chatter.control.cloner;

import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;

/**
 * @author Horizon
 * 
 */
public class ImageViewCloner {

	public ImageView clone(ImageView imageView, String newId) {

		// <ImageView blendMode="DARKEN" fitHeight="100.0" fitWidth="100.0" layoutY="1.0" onMouseClicked="#handleMouseClicked" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="1.0" />
		ImageView imv = new ImageView();
		imv.setBlendMode(imageView.getBlendMode());
		imv.setFitHeight(imageView.getFitHeight());
		imv.setFitWidth(imageView.getFitWidth());
		imv.setLayoutY(imageView.getLayoutY());
		imv.setPickOnBounds(imageView.isPickOnBounds());
		imv.setPreserveRatio(imageView.isPreserveRatio());
		imv.setOnMouseClicked(imageView.getOnMouseClicked());
		AnchorPane.setRightAnchor(imv, AnchorPane.getRightAnchor(imageView));
		imv.setId(newId);
		
		return imv;
	}
}
